<template>
	<page-body>
		<view class="page">
			<view class="flex benben-position-layout flex flex-wrap align-center talk_flex_0"
				:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
				<view class='flex flex-wrap align-center justify-between flex-sub talk_fd0_0'>
					<view class='flex flex-wrap align-center talk_fd0_0_c0'>
						<text class='fu-iconfont2  talk_fd0_0_c0_c0' @tap.stop="handleJumpDiy" data-type="back"
							data-url="1">&#xE794;</text>
					</view>
					<view class='flex flex-wrap align-stretch justify-center'>
						<text class='talk_fd0_0_c1_c0'>签到 </text>
					</view>
					<view class='flex flex-wrap align-center justify-end talk_fd0_0_c0'>
					</view>
				</view>
			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<view class="">
				<view class="gesture-container">
					<image v-if="code== 1" style="width: 492rpx; height: 310rpx;" src="/static/sign/success.png"
						mode=""></image>
					<image v-else style="width: 492rpx; height: 310rpx;" src="/static/sign/file.png" mode=""></image>
				</view>
				<view class="title-01">
					{{code== 1 ? '签到成功' : '签到失败 '}}
				</view>
				<view class="title-02">
					{{code== 1 ? timeZhuan() : '签到已结束，下次早点哦！'}}
				</view>

				<view class="scan-QR" @click.stop="goTop">
					返回课程
				</view>

			</view>
			<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
			<!---flex布局flex布局开始-->
			<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout talk_flex_1">

			</view>
			<!---flex布局flex布局结束-->
		</view>
	</page-body>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'

	export default {
		data() {
			return {
				code: '',
				time: ""
			}
		},
		computed: {
			// 计算属性
		},
		watch: {
			// 监听器
		},
		methods: {
			// 方法
			goTop() {
				uni.navigateBack({
					delta: 1 // 返回的页面数，1 表示返回上一级
				})
			},
			timeZhuan() {
				const ts = +this.time; // 秒级时间戳
				const date = new Date(ts * 1000); // 记得要乘 1000 变成毫秒

				const MM = String(date.getMonth() + 1).padStart(2, "0");
				const DD = String(date.getDate()).padStart(2, "0");
				const hh = String(date.getHours()).padStart(2, "0");
				const mm = String(date.getMinutes()).padStart(2, "0");

				return `${MM}-${DD} ${hh}:${mm}`
			}
		},
		// 小程序页面生命周期，如果是 uni-app 可以写
		onLoad(options) {
			this.code = options.code
			this.time = options.time
			console.log(this.code);
		},
		onReady() {},
		onShow() {},
		onHide() {},
		onUnload() {},
	}
</script>
<style lang="scss" scoped>
	.gesture-container {
		display: flex;
		justify-content: center;
		flex-direction: column;
		align-items: center;
		margin-top: 283rpx;
	}

	.title-01 {
		font-weight: 400;
		font-size: 32rpx;
		color: #333333;
		margin-top: 30rpx;
		text-align: center
	}

	.title-02 {
		font-weight: 400;
		font-size: 24rpx;
		color: #999999;
		margin-top: 16rpx;
		text-align: center
	}

	.scan-QR {
		width: 304rpx;
		height: 84rpx;
		border-radius: 8rpx 8rpx 8rpx 8rpx;
		border: 2rpx solid #145EFD;
		font-weight: 500;
		font-size: 36rpx;
		color: #145EFD;
		text-align: center;
		margin: 80rpx auto;
		line-height: 84rpx;
	}

	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #F8F8F8;
		background-size: 100% auto;
	}

	.talk_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.talk_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 700;
		color: #333333;
		line-height: 50rpx;
	}

	.talk_fd0_0_c0_c0 {
		font-size: 36rpx;
		color: #333;
	}

	.talk_fd0_0_c0 {
		width: 120rpx;
	}

	.talk_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
	}

	.talk_flex_1 {
		padding: 24rpx;
	}
</style>